import Book.Library;
import User.AdminUser;
import User.NormalUser;
import User.Users;

import java.util.Scanner;

public class Main {
    public static Users log_In(){
        System.out.println("欢迎来到，图书系统");
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入姓名：");
        String name = sc.nextLine();
        System.out.println("请选择身份：0 --》管理员  1 --》普通成员");
        int ret = sc.nextInt();
        if(ret == 0){
            return new AdminUser(name);
        }else {
            return new NormalUser(name);
        }
    }

    public static void main(String[] args) {
        Library library = new Library();
        Users users = log_In();
        while(true) {
            int ret = users.menu();
            users.doOperation(ret, library);
        }
    }
}
